public class FizzBuzz {
    private int num;

    public FizzBuzz(int num) {
        if (num < 1 || num > 100){
            throw new IllegalArgumentException("无效输入");
        }
        this.num = num;
    }
    public String fizzBuzz(){
        if (num % 3 == 0 && num % 5 == 0){
            return "FizzBuzz";
        } else if (num % 3 == 0) {
            return "Fizz";
        } else if (num % 5 == 0) {
            return "Buzz";
        }
        return String.valueOf(num);
    }
}